// 数组解构  如果解构不成功 undefined
let [a,b,c] = [1,2,3];
let [foo,[[bar],baz]]=[1,[[2],3]];
console.log(foo,bar,baz);
let [, , third] = ["foo","bar","baz"];
console.log(third);
let [x1,y1] = [1,2,3];
console.log(x1,y1);
let [head, ...tail] = [1, 2, 3, 4];
console.log(head) // 1
console.log(tail) // [2, 3, 4]
let [x, y, ...z] = ['a'];
console.log(x,y,z);// a undefined []
// 不完全解构 
let [m,n] = [1,2,3];
console.log(m,n)// 1,2
let [f1,[f2],f3] = [1,[2,3],4] ;
console.log(f1,f2,f3);// 1,2,4

